package com.jiji.miaosha.mapper.provide;

import com.jiji.miaosha.entity.UserPassword;

import java.util.Map;

public class UserPasswordMapperProvider extends BaseProvider{

    public String upSert(final Map<String, Object> map) {
        UserPassword userPassword= (UserPassword) map.get("password");

        StringBuffer sb = new StringBuffer(INSERT_PASSWORD).append(UPDATE);
        if (userPassword.getEncrptPassword() != null) {
            sb.append("encrpt_password=#{password.encrptPassword},");
        }
        if (userPassword.getUserId() != null) {
            sb.append("user_id=#{password.userId}");
        }
        return sb.toString();
    }
}
